home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 05.zip
/
BS1 part 5
/
IM_3.adf
/
Exec
/
piarc.LZH
/
resolver.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1992-08-20
|
4KB
|
188 lines
/*
* RESOLVER.rexx a P.I. module to display the Image from Imagemaster
* or Image Professional on DMI's Resolver.
*
*
* Written by: Barry Chalmers
* Last Update: May 7th, 1992
* For: Black Belt Systems image processing series IM, IM F/c, and IP.
* ---------------------------------------------------------------------------
* Revision: 1.00 Nov 10, 1991 - Initial release.
* 1.01 Feb 8, 1992 - SAGE support.
* 1.02 May 7, 1992 - Selective redraw;
* Preset EDD draw mode.
* Requires IM 9.11 or later.
*/
parse arg jackin dx1 dy1 dx2 dy2
import = 'IM_Port';
rrport = 'IMRES8';
if jackin = 'finish' then
do
plist = showlist('p');
if index(plist,'IMRES8') > 0 then
do
address('IMRES8');
'finish';
end
exit 0;
end
else if jackin > 0 then
do
redraw = 1;
end
else
do
redraw = 0;
address(import);
options results;
'jackin';
jackin = result;
options;
end
/*
* open rexxsupport.library -- needed for some functions
*/
if ~show('L',"rexxsupport.library") then do
if addlib('rexxsupport.library',0,-30,0) then do
/* everything's ok */
end;
else do
say 'We Have A Library Problem, Unable To Load "rexxsupport.library"';
say 'Cannot operate RESOLVER.rexx without this library - sorry!';
exit 10;
end;
end;
plist = showlist('p');
if index(plist,'IMRES8') = 0 then
do
cmdpath = 'c:';
if open(fhandle,'rexx:picmdpath','read') then /* open the file */
do
cmdpath = readln(fhandle);
call close(fhandle); /* close the file */
end
/* say 'RESOLVE being started'; ***/
address command 'run '||cmdpath||'resolve '||jackin;
looper = 'run';
loopc = 0;
do while looper = 'run'
loopc = loopc + 1;
call delay(50);
plist = showlist('p');
if index(plist,'IMRES8') = 0 then
do
if loopc = 60 then
do
say "Can't start the RESOLVE program!";
exit 10
end
end
else
do
looper = 'go';
end
end
/* ASK ALL THE HARD QUESTIONS HERE */
address(rrport);
'jack '||jackin;
address(import);
options results;
if redraw > 0 then
'gadgets "DMI Resolver","Display in Luma","Preset","Ordered","Preset","EDD"';
else
'gadgets "DMI Resolver","Display in Luma","Preset","Ordered","Preset","EDD","Chosen","EDD"';
rcolor = result-1;
options;
if rcolor < 0 then
do
address;
exit 0;
end
address(rrport);
'color '||rcolor;
address(rrport);
'progress 2';
address(import);
bufname = 'unnamed';
options results;
'current';
bufdata = result; /* get name of buffer, if there is one */
parse var bufdata bname ',' bnum ',' bx ',' by ',' btot ',' bmem ',' bparname ',' bparnum;
if bname ~= '<none>' then
do
bufname = bname;
end
address(rrport);
'name '||bufname;
address;
mode = 0;
i = 0;
pstr = "";
if EXISTS('ram:IMRESOLVERMODES.dat') = 1 then do
call OPEN(fhandle,'ram:IMRESOLVERMODES.dat','read');
do while EOF(fhandle) = 0
line = READLN(fhandle);
if EOF(fhandle) = 0 then do
parse var line xres ',' yres ',' dmode
xress.i = xres;
yress.i = yres;
modes.i = dmode;
if i > 0 then do
pstr = pstr||',';
end
pstr = pstr||'"'||xres||' x '||yres||'",'||'"Mode '||dmode||'"';
i = i + 1;
end
end
call CLOSE(fhandle);
address command delete||' >NIL ram:IMRESOLVERMODES.dat';
address(import);
options results;
'gadgets '||pstr;
dmires = result;
options;
if dmires = 0 then do
address;
exit 0;
end
dmires = dmires - 1;
end
mode = modes.dmires;
address(rrport);
'display '||mode;
redraw = 0;
end
address(rrport);
if redraw > 0 then
do
'redraw '||jackin||' '||dx1||' '||dy1||' '||dx2||' '||dy2;
end
else
do
'show';
end
address(import);
'finish';
address;
exit 0;